<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ attribute name="link" required="true"%>

<c:url value="${link}" var="order"/>
<c:if test="${empty param.search}">
  <div style="position:relative;display:inline;float:right;">
    <c:set var="page" value=""/>
    <c:if test="${param.p gt 0}">
        <c:set var="page" value="&p=${param.p}"/>
    </c:if>
    <c:if test="${empty param.o or param.o eq 0}">
        <spring:url value="/styles/default/images/order_asc.gif" var="src"/>
        <a href="${order}?o=1${page}"><img src="${src}"
        title="Order ASC, set to DESC" alt="Asc" /></a>
    </c:if>
    <c:if test="${param.o gt 0}">
        <spring:url value="/styles/default/images/order_desc.gif" var="src"/>
        <a href="${order}?o=0${page}"><img src="${src}"
        title="Order DESC, set to ASC" alt="Desc" /></a>
    </c:if>
  </div>
</c:if>